#！usr/bin/env python3
#-*- coding:utf-8 -*-
class Stack(object):
    def __init__(self):
        self._elems=[]

    def is_empty(self):
        return self._elems==[]

    def top(self):
        if self._elems==[]:
            raise StackUnderflow("in Stack.top()")
        return self._elems[-1]

    def push(self,elem):
        return self._elems.append(elem)

    def pop(self):
        if self._elems==[]:
            raise StackUnderflow("in Stack.top()")
        return self._elems.pop()
    pass




